home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 December / PCWDEC06.iso / Software / Trial / Paint Shop Pro XI / Data1.cab / msgcenter.htm < prev    next >
Encoding:
Extensible Markup Language  |  2006-08-04  |  13.4 KB  |  522 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE html
  3. PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
  4. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
  5. <html xmlns="http://www.w3.org/1999/xhtml">
  6.     <head>
  7.         <title></title>
  8.         <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR" />
  9.         <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema" />
  10.         <style type="text/css">
  11.             .msgcont1
  12.             {
  13.                 filter:progid:DXImageTransform.Microsoft.Iris(irisstyle=DIAMOND,motion=out);
  14.                 border-style:none;
  15.                 border-color:#2a567f;
  16.                 position:absolute;
  17.             }
  18.             .msgcont2
  19.             {
  20.                 filter:progid:DXImageTransform.Microsoft.Fade(duration=2);
  21.                 border-style:none;
  22.                 border-color:#2a567f;
  23.                 position:absolute;
  24.             }
  25.             .msgcont3
  26.             {
  27.                 filter:progid:DXImageTransform.Microsoft.Pixelate(MaxSquare=10,Duration=1, Enabled=true);
  28.                 border-style:none;
  29.                 border-color:#2a567f;
  30.                 position:absolute;
  31.             }
  32.             .msg
  33.             {
  34.                 visibility: hidden;
  35.             }
  36.             .TestingAid
  37.             {
  38.                 DISPLAY:none;
  39.                 POSITION: absolute;
  40.                 LEFT: 0px; TOP: 0px; width:190px;
  41.             }
  42.             .MsgInfo
  43.             {
  44.                 z-index:1;
  45.                 position:absolute;
  46.                 background-color:Yellow;
  47.                 display:none;
  48.                 width: 190px;
  49.                 height:200px;
  50.                 border-style:none;
  51.                 font-family: Verdana; font-size: 10pt;
  52.             }
  53.             .MessageBody
  54.             {
  55.                 WIDTH: 190px;
  56.                 HEIGHT: 200px;
  57.                 border-style:none;
  58.             }
  59.             BODY
  60.             {
  61.                 margin: 0px;
  62.                 overflow:hidden;
  63.             }
  64.         </style>
  65.         <script language="javascript" type="text/javascript">
  66.     <!--
  67.             //
  68.             // Retrieves a given parameter from the URL string
  69.             // Note: This function has been copied from ccc.js.
  70.             // TBD: Refactor the shared scripts
  71.             //
  72.     function getParamVal(paramName)
  73.     {
  74.         var sQueryVar = location.search.toLowerCase();
  75.         return extractParam(sQueryVar, paramName);
  76.     }
  77.  
  78.             //
  79.             // Extracts the given parameter from the given URL string
  80.             // Note: This function has been copied from ccc.js.
  81.             // TBD: Refactor the shared scripts
  82.             //
  83.     function extractParam(sQueryVar, paramName)
  84.     {
  85.         if (sQueryVar == null || paramName == null)
  86.             return "";
  87.  
  88.         var nIndex = sQueryVar.indexOf("?");
  89.         if (nIndex >= 0)
  90.             sQueryVar = sQueryVar.substr(nIndex + 1);
  91.  
  92.         paramName = paramName.toLowerCase();
  93.  
  94.         sQueryVar = sQueryVar.replace(/%26/g, "&");
  95.  
  96.         var asParams = sQueryVar.split("&");
  97.         var i;
  98.  
  99.         for (i in asParams)
  100.         {
  101.             var pair = asParams[i].split("=");
  102.             if (pair.length == 2)
  103.             {
  104.                 if (pair[0].toLowerCase() == paramName)
  105.                 {
  106.                     return pair[1];
  107.                 }
  108.             }
  109.         }
  110.  
  111.         return "";
  112.     }
  113.  
  114.       //
  115.             // Global variables
  116.             //
  117.     var oCurrentMessageXMLNode = null;
  118.     var transitionDuration = 2;
  119.     var timerID = 0;
  120.     var fShowingFixedMsg = false;
  121.     var displayedMsgStack = new Array();
  122.     var indexInDisplayedMsgStack = 0;
  123.     var fTestingMode = false;
  124.     var bRotationEnabled = true;
  125.  
  126.             //
  127.             // onLoad - called when the document is fully loaded
  128.             //
  129.       function onLoad()
  130.       {
  131.                 window.onerror = handleError;
  132.  
  133.                 // If testing is enabled, show testing aids
  134.                 var testing = getParamVal("testing");
  135.                 if (testing)
  136.                     fTestingMode = true;
  137.  
  138.                 // Previewing a message with a given ID?
  139.                 var msgID = getParamVal("msgid");
  140.                 if ( msgID )
  141.                 {
  142.                     // Show just the given message.
  143.                     // This prevents message rotation
  144.                     fShowingFixedMsg = true;
  145.                     showAMessage(msgID);
  146.                 }
  147.                 else
  148.                 {
  149.                     // Get the next message from the message sequence
  150.                     oCurrentMessageXMLNode = window.external.GetNextMessage();
  151.  
  152.                     // Push the msg ID onto the display stack
  153.                     // This is needed for walking back and forth the displayed
  154.                     // message sequence
  155.                     pushMsgOnDisplayStack(oCurrentMessageXMLNode);
  156.  
  157.                     // Show the message with transitions and auto-advance to the next one
  158.                     showMessage(oCurrentMessageXMLNode, true, true);
  159.                 }
  160.             }
  161.  
  162.             //
  163.             // Function to handle all error
  164.             //
  165.             function handleError(sMsg, sUrl, sLine)
  166.             {
  167.                 // If we are not in testing mode, supress error dialogs
  168.                 if ( !fTestingMode )
  169.                     return true;
  170.  
  171.                 // Display a detaled error message
  172.                 var sErrMsg = "Error occured!<br/>";
  173.                 sErrMsg += "Error: " + sMsg + "<br/>";
  174.                 sErrMsg += "at: " + sUrl + "<br/>";
  175.                 sErrMsg += "Line: " + sLine + "<br/>";
  176.               sErrMsg += "<br/>";
  177.               sErrMsg += "<br /><a href='#' onclick='onCloseInfo()'>Close</a>"
  178.  
  179.                 msgInfo.innerHTML = sErrMsg;
  180.                 msgInfo.style.display = "inline";
  181.  
  182.                 return true;
  183.             }
  184.  
  185.  
  186.         //
  187.         // pushMsgOnDisplayStack - Push the msg ID onto the display stack
  188.         // This is needed for walking back and forth the displayed
  189.         // message sequence
  190.         //
  191.       function pushMsgOnDisplayStack(oMessageXMLNode)
  192.       {
  193.                 var msgID = oCurrentMessageXMLNode.getAttribute("id");
  194.                 displayedMsgStack.push(msgID);
  195.             }
  196.  
  197.  
  198.       //
  199.       // showAMessage - Shows a single message without transitions or rotation
  200.       //
  201.       function showAMessage(msgID)
  202.       {
  203.                 oCurrentMessageXMLNode = window.external.GetMessage(msgID);
  204.                 showMessage(oCurrentMessageXMLNode, false, false);
  205.       }
  206.  
  207.       // gets called by app
  208.       // returns the Message ID to the app
  209.       function GetCurrentMsgID()
  210.       {
  211.           if (oCurrentMessageXMLNode != null)
  212.           {
  213.             var msgID = oCurrentMessageXMLNode.getAttribute("id");
  214.              return msgID;
  215.         }
  216.         return null;
  217.       }
  218.  
  219.       function GetCurrentMsgDetailURL()
  220.       {
  221.         var url = "";
  222.         var FullURLPath = "";
  223.         if (oCurrentMessageXMLNode != null)
  224.         {
  225.             var msgID = oCurrentMessageXMLNode.getAttribute("id");
  226.             var msgDetailURLNode =
  227.                 oCurrentMessageXMLNode.selectSingleNode("contents/content[@type='detail']/@localpath");
  228.             if ( msgDetailURLNode != null )
  229.             {
  230.                 url = msgDetailURLNode.value;
  231.                 FullURLPath = window.external.QualifyRelativePath(url);
  232.             }
  233.         }
  234.         return FullURLPath;
  235.       }
  236.  
  237.       function ActionCompleted()
  238.       {
  239.             // if there is a need to do an action upon the completion of a PCU action, it comes here
  240.       }
  241.  
  242.       function GetCurrentMsg()
  243.       {
  244.          return oCurrentMessageXMLNode;
  245.       }
  246.  
  247.       //
  248.       // showAMessage - Shows the given message
  249.       //
  250.       function showMessage(oMsgXMLNode, showTransition, autoAdvance)
  251.       {
  252.                 // Get the message body URL
  253.                 var contentURL = oMsgXMLNode.selectSingleNode("contents/content[@type='body']/@localpath");
  254.  
  255.                 // Transition out the current message
  256.                 if ( showTransition )
  257.                     messageBodyDiv.filters[0].Apply();
  258.  
  259.                 // Show the new message
  260.                 var FullURLPath = window.external.QualifyRelativePath(contentURL.text);
  261.  
  262.                 document.all.messageBody.src = FullURLPath;
  263.  
  264.                 // .. and transition in the new message
  265.                 if ( showTransition )
  266.                     messageBodyDiv.filters[0].Play();
  267.  
  268.                 //
  269.                 // Set auto-advance timer
  270.                 //
  271.                 if ( autoAdvance )
  272.                 {
  273.                     startMsgRotation();
  274.  
  275.                     // if the call to show the message comes from message archive, do the callback
  276.                     window.external.OnMsgDisplayed(oMsgXMLNode);
  277.                 }
  278.       }
  279.  
  280.             //
  281.             // nextMsg - Advances to the next message
  282.             //                     Called from either the message rotation or the testing aid
  283.             //
  284.     function nextMsg(showTransition)
  285.     {
  286.         if (bRotationEnabled)
  287.         {
  288.             // The next message may come from the display stack if we
  289.             // are not at the top of the stack (due to the tester re-traced back through the
  290.             // displayed messages)
  291.             if ( indexInDisplayedMsgStack == 0 )
  292.             {
  293.                 // We are at the top of the stack - get the next message from the sequence
  294.                 // and push it into the stack
  295.                 oCurrentMessageXMLNode = window.external.GetNextMessage();
  296.                 pushMsgOnDisplayStack(oCurrentMessageXMLNode);
  297.             }
  298.             else
  299.             {
  300.                 // Get the next message from the stack
  301.                 indexInDisplayedMsgStack++;
  302.                 var nextMsgID = displayedMsgStack[displayedMsgStack.length + indexInDisplayedMsgStack - 1];
  303.                 oCurrentMessageXMLNode = window.external.GetMessage(nextMsgID);
  304.             }
  305.  
  306.             //... and show the message
  307.             showMessage(oCurrentMessageXMLNode, showTransition, true);
  308.         }
  309.         else
  310.         {
  311.             startMsgRotation();
  312.         }
  313.     }
  314.  
  315.     //
  316.     // prevMsg - re-winds to the previous message
  317.     //                     Called only from the testing aid
  318.     //
  319.     function prevMsg(showTransition)
  320.     {
  321.         if ( indexInDisplayedMsgStack <= -(displayedMsgStack.length-1) )
  322.         {
  323.             // We are at the bottom of the stack.
  324.             showMessage(oCurrentMessageXMLNode, showTransition, true);
  325.             return;
  326.         }
  327.  
  328.         // Get the next message from the stack and display it
  329.         indexInDisplayedMsgStack--;
  330.         var msgIndex = displayedMsgStack.length + indexInDisplayedMsgStack - 1;
  331.  
  332.         var prvMsgID = displayedMsgStack[msgIndex];
  333.         oCurrentMessageXMLNode = window.external.GetMessage(prvMsgID);
  334.         showMessage(oCurrentMessageXMLNode, showTransition, true);
  335.     }
  336.  
  337.     //
  338.     // onTestPrev - Called when the tester clicks on back button
  339.     //                            to view the previous message
  340.     //
  341.     function onTestPrev()
  342.     {
  343.         // Stop the auto-rotation timer
  344.         stopMsgRotation();
  345.  
  346.         // and rewind to the previous message without transition
  347.         prevMsg(false);
  348.         return true;
  349.     }
  350.  
  351.  
  352.             //
  353.             // onTestNext - Called when the tester clicks on next button
  354.             //                            to view the next message
  355.             //
  356.             function onTestNext()
  357.             {
  358.                 // Stop the auto-rotation timer
  359.                 stopMsgRotation();
  360.  
  361.               // and advance to the next message without transition
  362.                 nextMsg(false);
  363.                 return true;
  364.             }
  365.  
  366.             //
  367.             // onMouseOverBody - Called when the mouse hovers over tht message body
  368.             //
  369.             function onMouseOverBody()
  370.             {
  371.                 // Don't bother if testing mode is not enabled
  372.                 // ie., no "testing=1" in the URL param
  373.                 if ( !fTestingMode )
  374.                     return;
  375.  
  376.                 // Show the testing aid
  377.                 var testingAidElem = document.getElementById("testingAid");
  378.                 if ( testingAidElem != null )
  379.                     testingAidElem.style.display = "inline";
  380.             }
  381.  
  382.             //
  383.             // onMouseOutOfBody - Called when mouse is out of message body
  384.             //
  385.             function onMouseOutOfBody()
  386.             {
  387.                 if ( !fTestingMode )
  388.                     return;
  389.  
  390.                 // Hide testing aid
  391.                 testingAid.style.display = "none";
  392.             }
  393.  
  394.  
  395.             //
  396.             // onInfo - Called when the tester clicks on '?' button
  397.             //
  398.             function onInfo()
  399.             {
  400.                 // Clear the rotation timer
  401.               stopMsgRotation();
  402.  
  403.               var msg = oCurrentMessageXMLNode;
  404.  
  405.               var sMsg = "<b>Message Information</b><br/>";
  406.               sMsg +=    "ID:       " + msg.getAttribute("id")       + "<br/>";
  407.               sMsg +=    "Title:    " + msg.getAttribute("title")    + "<br/>";
  408.               sMsg +=    "Priority: " + msg.getAttribute("priority") + "<br/>";
  409.               sMsg +=    "Type:     " + msg.getAttribute("type")     + "<br/>";
  410.               sMsg +=    "Duration: " + msg.getAttribute("duration") + " sec<br/>";
  411.               sMsg +=    "Contexts: ";
  412.  
  413.               var contextNodeList;
  414.               contextNodeList = msg.selectNodes("contexts/context/@id");
  415.               if ( contextNodeList.length == 0 )
  416.               {
  417.                     sMsg += "-";
  418.               }
  419.               else
  420.               {
  421.                     for ( var i = 0; i < contextNodeList.length; i++ )
  422.                     {
  423.                         var contextNode;
  424.                         contextNode = contextNodeList.item(i);
  425.                         var context;
  426.                         context = contextNode.nodeValue;
  427.                         if ( i > 0 )
  428.                             sMsg += ", ";
  429.                         sMsg += context;
  430.                     }
  431.               }
  432.               sMsg += "<br/>";
  433.               sMsg += "<br /><a href='#' onclick='onCloseInfo()'>Close</a>"
  434.  
  435.               msgInfo.innerHTML = sMsg;
  436.               msgInfo.style.display = "inline";
  437.             }
  438.  
  439.             //
  440.             // onCloseInfo - Called to close the msg info window
  441.             //
  442.             function onCloseInfo()
  443.             {
  444.                 msgInfo.style.display = "none";
  445.                 showMessage(oCurrentMessageXMLNode, true, true);
  446.                 return true;
  447.             }
  448.  
  449.             function onbeforeprint()
  450.             {
  451.                 if ( !fTestingMode )
  452.                     return;
  453.  
  454.                 var testingAidElem = document.getElementById("testingAid");
  455.                 testingAidElem.style.display = "none";
  456.             }
  457.  
  458.             function onafterprint()
  459.             {
  460.                 if ( !fTestingMode )
  461.                     return;
  462.  
  463.                 var testingAidElem = document.getElementById("testingAid");
  464.  
  465.                 testingAidElem.style.display = "inline";
  466.             }
  467.  
  468.             // Called to suspend/resume message rotation
  469.             function setMsgRotation(fRotate)
  470.             {
  471.                 bRotationEnabled = fRotate;
  472.             }
  473.  
  474.             function startMsgRotation()
  475.             {
  476.                 if (oCurrentMessageXMLNode != null)
  477.                 {
  478.                     var msgDuration = parseInt(oCurrentMessageXMLNode.getAttribute("duration"), 10);
  479.                     msgDuration = msgDuration + transitionDuration;
  480.                     timerID = window.setTimeout("nextMsg(true)", msgDuration * 1000);
  481.                 }
  482.             }
  483.  
  484.             function stopMsgRotation()
  485.             {
  486.                 window.clearTimeout(timerID);
  487.                 timerID = 0;
  488.             }
  489.  
  490.         -->
  491.         </script>
  492.     </head>
  493.     <body onmouseover="onMouseOverBody()" onmouseout="onMouseOutOfBody()" onload="onLoad()"
  494.         onbeforeprint="onbeforeprint()" onafterprint="onafterprint()" style="margin: 0px;overflow:hidden;">
  495.         <div class="msgcont2" id="messageBodyDiv">
  496.             <iframe id="messageBody" class="MessageBody" src="" frameborder="0"></iframe>
  497.         </div>
  498.         <div id="msgInfo" class="MsgInfo">
  499.         </div>
  500.         <div id="testingAid" class="TestingAid">
  501.             <table width="100%" border="0" ID="Table1">
  502.                 <tr>
  503.                     <td style="text-align:left; width:10px;">
  504.                         <a onclick="onTestPrev()" href="#"><</a>
  505.                     </td>
  506.                     <td style="text-align:left; width:10px;">
  507.                         <a onclick="onInfo()" href="#">?</a>
  508.                     </td>
  509.                     <td></td>
  510.                     <td align="center"></td>
  511.                     <td style="text-align:left; width:10px;">
  512.                         <a onclick="window.print()" href="#"><font face="Wingdings 2">6</font></a>
  513.                     </td>
  514.                     <td style="text-align:right; width:10px;">
  515.                         <a onclick="onTestNext()" href="#">></a>
  516.                     </td>
  517.                 </tr>
  518.             </table>
  519.         </div>
  520.     </body>
  521. </html>
  522.